#pragma once

#include "dfize.h"
#include "CBlockSceneNode.h"
#include "CBatchingMesh.h"

class CBlockCollection
{
public:
	CBlockCollection();
	~CBlockCollection();

	void addBlock(CBlockSceneNode *block);

	void removeBlock(CBlockSceneNode *block);
	void removeBlock(u32 i);

	u32 getBlockCount() const;

	void getBlocks(array<CBlockSceneNode*> &blocks);

	const aabbox3df& getBoundingBox() const;

	void render(bool batch);

	void updateTiles();

	bool Visible;

protected:
	array<CBlockSceneNode*> Blocks;

	aabbox3df BoundingBox;
	bool HasBox;

	CBatchingMesh *BatchMesh;
};